package com.woniuxy.test01;

/**
 * @Author author
 * @Create 2023-09-12 9:50
 */
public class MyTest01 {
    public static void main(String[] args) throws CloneNotSupportedException {
        School school = new School(1, "school001");
        Student student1 = new Student(1, "zs", 11,school);
        Object student2 = student1.clone();
        System.out.println(student1==student2);
        System.out.println("student1="+student1);
        System.out.println("student2="+student2);
        student1.setAge(15);
        student1.getSchool().setScid(2);
        student1.getSchool().setScname("school002");
//        student1.setSchool(new School(2, "school002"));
        student1.setSchool(school);
        System.out.println("student1="+student1);
        System.out.println("student2="+student2);

//        Student student3= new Student(1, "zs", 11);
//        Student student4=student3;
//        System.out.println("student3="+student3);
//        System.out.println("student4="+student4);
//        student3.setAge(20);
//        System.out.println("student3="+student3);
//        System.out.println("student4="+student4);
    }
}
